home *** CD-ROM | disk | FTP | other *** search
/ Delphi Magazine Collection 2001 / Delphi Magazine Collection 20001 (2001).iso / DISKS / ISSUE02 / XTOOLS / XTOOL.ZIP / DBSTATUS.INT < prev    next >
Encoding:
Text File  |  1995-05-28  |  2.3 KB  |  82 lines

  1. {*******************************************************}
  2. {                                                       }
  3. {       xTool - Component Collection                    }
  4. {                                                       }
  5. {       Copyright (c) 1995 Stefan B÷ther                }
  6. {                                                       }
  7. {*******************************************************}
  8. unit DbStatus;
  9.  
  10. {$R DBSTATUS }
  11.  
  12. interface
  13.  
  14. uses
  15.   WinTypes, WinProcs, SysUtils,
  16.   Classes, Graphics,Dialogs, Forms, Menus,
  17.   Controls, StdCtrls, ExtCtrls,
  18.   Db, DbTables, DbCtrls;
  19.  
  20. type
  21.   TBitmapArrayRange = 0..3;
  22.   TBitmapArray  = array[TBitmapArrayRange] of TBitmap;
  23.  
  24.   TStatusDataLink = class;
  25.  
  26.   TDbStatus = class(TCustomPanel)
  27.   private
  28.     FDataLink: TStatusDataLink;
  29.     FNavigator: TDbNavigator;
  30.     FPictures: TBitmapArray;
  31.     FLastState: TDataSetState;
  32.     FButtonWidth: Integer;
  33.     FBrowseButtons: TButtonSet;
  34.     FEditButtons: TButtonSet;
  35.     function  GetDataSource: TDataSource;
  36.     procedure SetDataSource(Value: TDataSource);
  37.     function  GetNavigator: TDbNavigator;
  38.     procedure SetNavigator(Value: TDbNavigator);
  39.     procedure CreateGlyph;
  40.   protected
  41.     procedure Notification(AComponent: TComponent; Operation: TOperation); override;
  42.     procedure Paint; override;
  43.     procedure DataChanged;
  44.     procedure EditingChanged;
  45.     procedure ActiveChanged;
  46.   public
  47.     constructor Create(aOwner:TComponent); override;
  48.     destructor  Destroy; override;
  49.   published
  50.     property DataSource: TDataSource read GetDataSource write SetDataSource;
  51.     property Navigator: TDbNavigator read GetNavigator write SetNavigator;
  52.     property DragCursor;
  53.     property DragMode;
  54.     property Ctl3D;
  55.     property ParentCtl3D;
  56.     property ParentShowHint;
  57.     property PopupMenu;
  58.     property ShowHint;
  59.     property Visible;
  60.     property OnDragDrop;
  61.     property OnDragOver;
  62.     property OnEndDrag;
  63.   end;
  64.  
  65.   { TStatusDataLink }
  66.  
  67.   TStatusDataLink = class(TDataLink)
  68.   private
  69.     FStatus: TDBStatus;
  70.   protected
  71.     procedure EditingChanged; override;
  72.     procedure DataSetChanged; override;
  73.     procedure ActiveChanged; override;
  74.   public
  75.     constructor Create(AStatus: TDBStatus);
  76.     destructor  Destroy; override;
  77.   end;
  78.  
  79.  
  80.   procedure Register;
  81.  
  82.